class ArrayList<T = number> {
  arr: Array<T>;
  index: number = 0;
  constructor() {
    this.arr = [];
  }
  add(ele: T) {
    this.arr.push(ele);
  }
  get(index: number) {
    return this.arr[index];
  }
}

let list = new ArrayList<string>();
list.add("abc");
list.add("1221");
console.log(list.get(0));

type TypeStudent = { username: string; age: number };
let list2 = new ArrayList<TypeStudent>();
list2.add({
  username: "zs",
  age: 123,
});
console.log(list2.get(0));

let list3 = new ArrayList();
list3.add(1);
console.log(list3.get(0));

export {};
